package test.func;

import cn.heygod.airsql.build.SelectSql;
import cn.heygod.airsql.Sql;
import test.bean.User;

import java.lang.reflect.Method;
import java.util.function.Function;
import java.util.function.Supplier;

/**
 * @className: FunctionTest1
 * @author: Simon
 * @description: TODO
 * @date: 2024/1/22 1:37
 * @version: 1.0
 */
public class FunctionTest1<T> {

    public static void main(String[] args) throws NoSuchMethodException {
        User user = new User();
        //new FunctionTest1<User>().eq(User::getUserName);
       // SqlTest.of(User.class).eq(User::getUserName,"23").list();

        SelectSql<User> builder = Sql.select(User.class);
        builder.eq(User::getUserName,"Tom");
        builder.desc(User::getAge);

        Sql.select(User.class)
                .eq(User::getUserName,"Tom")
                .asc(User::getAge);

        System.out.println("That is OK! This is OkSQL.");
    }


    public  void test(Function<?,?> func){
        Class cls = func.getClass();
        System.out.println(func);
    }

    public  void test(Supplier<?> supplier){
    }

    public void eq(OkSqlFunction<T,?> keyFunc,Object... val) throws NoSuchMethodException {
        Class cls = keyFunc.getClass();
        Method method = cls.getDeclaredMethod("writeReplace", new Class[0]);
        System.out.println(method);
    }
}
